home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 824 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.0 KB  |  61 lines

  1. Path: chronicle.mti.sgi.com!austern
  2. From: jpotter@falcon.lhup.edu (John E. Potter)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Forward declaration of class member functions
  5. Date: 22 Mar 1996 09:29:25 PST
  6. Organization: East Stroudsburg University, Pennsylvania
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4iu3mn$t15@jake.esu.edu>
  9. References: <UPMAIL07.199603182248040068@msn.com>
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. X-Original-Date: 22 Mar 1996 11:42:15 GMT
  12. X-Newsreader: TIN [version 1.2 PL2]
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMVLjj0y4NqrwXLNJAQHK/AH+NnD9WGPguUnLic0QVQ9do/P/iq5QtY8L
  15.     wnq4+V1h2QlTCinQ69S9aFQkz3g9slVVfnFnLwQpfCsTuFZjtNH4XQ==
  16.     =1PZP
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. Ron Burk (RonBurk@msn.com) wrote:
  20. : I am having difficulty finding language in the draft
  21. : that establishes the legality or illegality of the following:
  22.  
  23. : class Forward;
  24.  
  25. : class Any {
  26. :     friend int Forward::SomeFunc(int SomeArg);
  27. :     };
  28.  
  29. : It certainly seems like a useful construct, and I don't
  30. : see any impossibility in implementing it
  31.  
  32. Not enough of a lawyer to find it; however, the basic idea is that you can
  33. not talk about the inside of something that has not been seen.  But I do
  34. see some problems.  Let's add a little bit more from another thread
  35. with discussion of a camel's nose inside of the tent.
  36.  
  37. class Forward::Node;  // also illegal
  38. Forward::Node* ptr;
  39. ...
  40. class Forward {
  41.     private :
  42.         class Node {
  43.             // ...
  44.             };
  45.         int SomeFunc(int SomeArg);
  46.     };
  47.  
  48. Now what?  You can not talk about a private nested class.  You can't call
  49. a private member function.  Can you make it a friend?  What is the big
  50. picture here?
  51.  
  52. Enjoy,
  53. John
  54. ---
  55. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  56.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  57.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  58.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  59.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  60. ]
  61.